#include<stdio.h>
#include<math.h>
int Isprimer(int x)
{
    if(x == 1) return 0;
    if(x == 2) return 1;
    //printf("x=%d\n",x);
    for(int i = 2; i <= sqrt(x); i++)
    {
        //printf("%d %d\n",x,i);
        if(x % i == 0)
        {
            return 0;
        }
    }
    return 1;
}
int main()
{
    //freopen("in.txt","r",stdin);
    int count = 0;
    int n;
    scanf("%d",&n);
    for(int i = 0; i < n; i++)
    {
        int temp;
        scanf("%d",&temp);
        if(Isprimer(temp)){
            //printf("%d",temp);
            count++;
        }
    }
    printf("%d",count);
}